package com.info.zhiduoduo.admin.controller;

import com.info.zhiduoduo.admin.model.formbean.company.*;
import com.info.zhiduoduo.admin.service.CompanyRelationshipService;
import com.info.zhiduoduo.common.constants.SmartResult;
import com.info.zhiduoduo.common.formbean.BaseSimpleFormBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "企业关系接口")
@RestController
@RequestMapping("/company/relationship")
public class CompanyRelationshipController {

	@Resource
	CompanyRelationshipService companyRelationshipService;

    @ApiOperation("新增企业关系")
    @PostMapping("/saveCompanyRelationship")
    public SmartResult saveCompanyRelationship(@RequestBody BaseSimpleFormBean<SaveCompanyRelationshipFormBean> formBean) {
        return companyRelationshipService.saveCompanyRelationship(formBean);
    }

    @ApiOperation("查询企业关系")
    @PostMapping("/queryCompanyRelationshipList")
    public SmartResult queryCompanyRelationshipList(@RequestBody BaseSimpleFormBean<QueryCompanyRelationshipListFromBean> formBean) {
        return companyRelationshipService.queryCompanyRelationshipList(formBean);
    }
}
